package com.qiangesoft.blog.file.enums;

/**
 * 文件存储枚举
 *
 * @author qiange
 * @date 2023-04-26
 */
public enum FileStoreTypeEnum {

    FILE_LOCAL("01"),

    FILE_MINIO("02");

    private String code;

    FileStoreTypeEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static FileStoreTypeEnum getEnumByCode(String code) {
        for (FileStoreTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
